/*
 * Copyright(C) 2019 FUYUN DATA SERVICES CO.,LTD. - All Rights Reserved
 * Unauthorized copying of this file, via any medium is strictly prohibited
 * Proprietary and confidential
 * 该源代码版权归属福韵数据服务有限公司所有
 * 未经授权，任何人不得复制、泄露、转载、使用，否则将视为侵权
 *
 */

import * as React from 'react';

interface IProps extends React.HTMLAttributes<HTMLDivElement> {
  title?: string;
  width?: number | string;
}

const TitleCard: React.SFC<IProps> = props => {
  return (
    <div
      className={props.className}
      style={{
        background: 'rgba(255,255,255,1)',
        width: props.width ? props.width : '',
        padding: '0 20px',
        ...props.style
      }}
    >
      {props.title ? (
        <div
          style={{
            fontSize: 18,
            fontWeight: 'bold',
            color: 'rgba(0,0,0,0.65)',
            padding: '10px 0'
          }}
        >
          {props.title}
        </div>
      ) : null}
      {props.children}
    </div>
  );
};

export default TitleCard;
